﻿#include "ForwardStep.h"
#include "Timer.h"
#include "worklet/ComputeResidual.h"
#include "worklet/InitialCondition.h"
#include "worklet/MeshModifier.h"


ForwardStep::ForwardStep(const Configuration& cfg)
  : EulerEquation(cfg)
{
}

void ForwardStep::Init()
{
  EulerEquation::Init();
  //Loops::MeshModifier(_mesh);
}

void ForwardStep::InitialCondition()
{
  _timer.Start();
  Loops::InitialConditionPassFlow(*this);
  console::Success("初始条件设置完成", _timer.GetElapsedTime(), "s");
}

void ForwardStep::UpdateResidual()
{
  //std::this_thread::sleep_for(std::chrono::milliseconds(250));

  _timer.Start();
  Loops::ComputeResidual(*this);
  console::Info("ForwardStep::UpdateResidual运行完成，", "时间: ", _timer.GetElapsedTime(), " s");
}